pragma Singleton
import QtQuick

QtObject {
    id: root

    property var themes: {
        "黑灯瞎火": {
            "isDark": true,
            "background": Qt.rgba(0, 0, 0, 1),
            "mainBackground": Qt.rgba(19 / 255, 19 / 255, 19 / 255, 0.9),
            "primary": Qt.rgba(150 / 255, 150 / 255, 150 / 255, 1.0),
            "text": Qt.rgba(255 / 255, 255 / 255, 255 / 255, 1.0)
        },
        "绿意盎然": {
            "isDark": false,
            "background": Qt.rgba(209 / 255, 234 / 255, 221 / 255, 1.0),
            "mainBackground": Qt.rgba(255 / 255, 255 / 255, 255 / 255, 1.0),
            "primary": Qt.rgba(77 / 255, 175 / 255, 124 / 255, 1.0),
            "text": Qt.rgba(0 / 255, 0 / 255, 0 / 255, 1.0)
        }
    }
    property string currentTheme: "黑灯瞎火"
    property bool isDark: themes[currentTheme].isDark
    property color background: themes[currentTheme].background
    property color primary: themes[currentTheme].primary
    property color mainBackground: themes[currentTheme].mainBackground
    property color button: isDark ? Qt.darker(primary, 1.4) : Qt.lighter(primary, 1.4)
    property color text: themes[currentTheme].text
    property int textSize: 12
    property int textSize2: 14
    property int textSize3: 16

    Behavior on background {

        ColorAnimation {
            duration: 200
        }
    }
    Behavior on mainBackground {

        ColorAnimation {
            duration: 200
        }
    }
    Behavior on primary {

        ColorAnimation {
            duration: 200
        }
    }
    Behavior on text {

        ColorAnimation {
            duration: 200
        }
    }
}
